'use strict';
//  导航栏 侧边
module.exports = {
  up: async (queryInterface, Sequelize) => {
    const { INTEGER, STRING, DATE, ENUM } = Sequelize;
    // 创建表
    await queryInterface.createTable('admin_nav', {
      id: {
        type: INTEGER(30).UNSIGNED,
        primaryKey: true,
        autoIncrement: true
      },
      text: {
        type: STRING(100),
        allowNull: false,
        defaultValue: '',
        comment: '名称',
      },
      path: {
        type: STRING(100),
        allowNull: false,
        defaultValue: '',
        comment: '路径',
      },
      name: {
        type: STRING(100),
        allowNull: false,
        defaultValue: '',
        comment: '标题',
      },
      component: {
        type: STRING(200),
        allowNull: false,
        defaultValue: '',
        comment: '关键词',
      },
      created_at: DATE,
      updated_at: DATE,
    });
  },

  down: async (queryInterface, Sequelize) => {
    await queryInterface.dropTable('admin_nav');
  }
};